{
    "SPDXID": "SPDXRef-DOCUMENT",
    "spdxVersion": "SPDX-2.3",
    "name": "${documentName}",
    "documentNamespace": "${documentNamespace}",
    "dataLicense": "CC0-1.0",
    "creationInfo": {
        "creators": {
            "Person: "${user}",
            "Organization: "${userGroup}",
            "Tool: sbom-generate-tool-1.0"
        },
        "created": "${created}",
        "comment": "基于SPDX-2.3生成"
    },
    "packages": [
        <#list packages as package>
        {
            "SPDXID": "${package.id}",
            "name": "${package.name}",
            "versionInfo": "${package.version}",
            "packageFileName": "${package.fileName}",
            "supplier": "NOASSERTION",
            "originator": "NOASSERTION",
            "downloadLocation": "${package.downloadLocation}",
            "filesAnalyzed": false,
            "packageVerificationCode": "NONE",
            <#if package.checksum == "NOASSERTION">
            "checksums": [
                {
                    "algorithm": "NOASSERTION",
                    "checksumValue": "NOASSERTION"
                }
            ],
            <#else>
            "checksums": [
                {
                    "algorithm": "MD5",
                    "checksumValue": "${package.checksum}"
                }
            ],
            </#if>
            "homepage": "${package.homePage}",
            "sourceInfo": "${package.sourceInfo}",
            <#if package.licenseConcluded == "NOASSERTION">
            "licenseConcluded": "NOASSERTION",
            <#else>
            "licenseConcluded": "${package.licenseConcluded}",
            </#if>
            "licenseInfoFromFiles": "NONE",
            <#if package.licenseConcluded == "NOASSERTION">
            "licenseDeclared": "NOASSERTION",
            <#else>
            "licenseDeclared": "${package.licenseConcluded}",
            </#if>
            "licenseComments": "NONE",
            "copyrightText": "NOASSERTION",
            "summary": "${package.summary}",
            "description": "${package.description}",
            "comment": "NOASSERTION",
            "externalRefs": [
                {
                    "referenceCategory": "PACKAGE_MANAGER",
                    "referenceType": "purl",
                    "referenceLocator": "pkg:${package.externalRef}",
                    "comment": "NOASSERTION"
                }
            ],
            "attributionTexts": "NOASSERTION",
            "primaryPackagePurpose": "LIBRARY",
            "releaseDate": "${package.releaseDate}",
            "builtDate": "NOASSERTION",
            "validUntilDate": "NOASSERTION"
        }<#if package_has_next>,</#if>
        </#list>
    ],
    "relationships": [
        <#list relationships as relationship>
        "${relationship.id} DEPENDENCY_OF ${relationship.parentId}"
        <#if relationship_has_next>,</#if>
        </#list>
    ]
} 